﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;

namespace RatpConsole
{
    class WebGrab
    {
        private String url;

        public WebGrab(String url)
        {
            this.url = url;
        }

        public String grab()
        {
            try
            {
                WebRequest adress = WebRequest.Create(url);
                WebResponse response = adress.GetResponse();
                StreamReader input = new StreamReader(response.GetResponseStream());
                return input.ReadToEnd().ToString();
            }
            catch (Exception e)
            {
                return e.Message;
            }
        }
    }
}
